import java.util.Scanner;
public class test
{
    public static void main(String[] args)
    {


        Scanner key=new Scanner(System.in);
        System.out.println("-----------对学生类的排序测试(按成绩升序排序)-------------");
        System.out.println("请输入学生人数:");
        int n=key.nextInt();

        student[][] A=new student[3][n];

        for(int i=0;i<n;i++)
        {
            System.out.print("\n请输入第"+(i+1)+"个学生的姓名和成绩:");
            String t=key.next();
            int kk=key.nextInt();
            A[0][i]=new student(kk,t);
            A[1][i]=new student(kk,t);
            A[2][i]=new student(kk,t);
        }

        ArraySorter.selectionSort(A[0]);
        System.out.println("\n选择排序后为：");
        for(int i=0;i<n;i++)
        {
            System.out.print(A[0][i].getName()+": "+A[0][i].getScore()+"\t\t");
            if((i+1)%6==0) System.out.println();
        }

        ArraySorter.bubbleSort(A[1]);
        System.out.println("\n\n冒泡排序后为：");
        for(int i=0;i<n;i++)
        {
            System.out.print(A[1][i].getName()+": "+A[1][i].getScore()+"\t\t");
            if((i+1)%6==0) System.out.println();
        }
        ArraySorter.insertionSort(A[2]);
        System.out.println("\n\n插入排序后为：");
        for(int i=0;i<n;i++)
        {
            System.out.print(A[2][i].getName()+": "+A[2][i].getScore()+"\t\t");
            if((i+1)%6==0) System.out.println();
        }


    }
}
